/**
 */
package usixmlcui.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import usixmlcui.BorderLayout;
import usixmlcui.ConcreteGraphicalRelationship;
import usixmlcui.Usixml_cuiPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Border Layout</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link usixmlcui.impl.BorderLayoutImpl#getNorth <em>North</em>}</li>
 *   <li>{@link usixmlcui.impl.BorderLayoutImpl#getEast <em>East</em>}</li>
 *   <li>{@link usixmlcui.impl.BorderLayoutImpl#getSouth <em>South</em>}</li>
 *   <li>{@link usixmlcui.impl.BorderLayoutImpl#getWest <em>West</em>}</li>
 *   <li>{@link usixmlcui.impl.BorderLayoutImpl#getCenter <em>Center</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BorderLayoutImpl extends ConcreteGraphicalRelationshipImpl implements BorderLayout {
	/**
	 * The cached value of the '{@link #getNorth() <em>North</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNorth()
	 * @generated
	 * @ordered
	 */
	protected ConcreteGraphicalRelationship north;

	/**
	 * The cached value of the '{@link #getEast() <em>East</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEast()
	 * @generated
	 * @ordered
	 */
	protected ConcreteGraphicalRelationship east;

	/**
	 * The cached value of the '{@link #getSouth() <em>South</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSouth()
	 * @generated
	 * @ordered
	 */
	protected ConcreteGraphicalRelationship south;

	/**
	 * The cached value of the '{@link #getWest() <em>West</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getWest()
	 * @generated
	 * @ordered
	 */
	protected ConcreteGraphicalRelationship west;

	/**
	 * The cached value of the '{@link #getCenter() <em>Center</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCenter()
	 * @generated
	 * @ordered
	 */
	protected ConcreteGraphicalRelationship center;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BorderLayoutImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return Usixml_cuiPackage.Literals.BORDER_LAYOUT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship getNorth() {
		if (north != null && north.eIsProxy()) {
			InternalEObject oldNorth = (InternalEObject)north;
			north = (ConcreteGraphicalRelationship)eResolveProxy(oldNorth);
			if (north != oldNorth) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, Usixml_cuiPackage.BORDER_LAYOUT__NORTH, oldNorth, north));
			}
		}
		return north;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship basicGetNorth() {
		return north;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNorth(ConcreteGraphicalRelationship newNorth) {
		ConcreteGraphicalRelationship oldNorth = north;
		north = newNorth;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Usixml_cuiPackage.BORDER_LAYOUT__NORTH, oldNorth, north));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship getEast() {
		if (east != null && east.eIsProxy()) {
			InternalEObject oldEast = (InternalEObject)east;
			east = (ConcreteGraphicalRelationship)eResolveProxy(oldEast);
			if (east != oldEast) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, Usixml_cuiPackage.BORDER_LAYOUT__EAST, oldEast, east));
			}
		}
		return east;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship basicGetEast() {
		return east;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEast(ConcreteGraphicalRelationship newEast) {
		ConcreteGraphicalRelationship oldEast = east;
		east = newEast;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Usixml_cuiPackage.BORDER_LAYOUT__EAST, oldEast, east));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship getSouth() {
		if (south != null && south.eIsProxy()) {
			InternalEObject oldSouth = (InternalEObject)south;
			south = (ConcreteGraphicalRelationship)eResolveProxy(oldSouth);
			if (south != oldSouth) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, Usixml_cuiPackage.BORDER_LAYOUT__SOUTH, oldSouth, south));
			}
		}
		return south;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship basicGetSouth() {
		return south;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSouth(ConcreteGraphicalRelationship newSouth) {
		ConcreteGraphicalRelationship oldSouth = south;
		south = newSouth;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Usixml_cuiPackage.BORDER_LAYOUT__SOUTH, oldSouth, south));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship getWest() {
		if (west != null && west.eIsProxy()) {
			InternalEObject oldWest = (InternalEObject)west;
			west = (ConcreteGraphicalRelationship)eResolveProxy(oldWest);
			if (west != oldWest) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, Usixml_cuiPackage.BORDER_LAYOUT__WEST, oldWest, west));
			}
		}
		return west;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship basicGetWest() {
		return west;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setWest(ConcreteGraphicalRelationship newWest) {
		ConcreteGraphicalRelationship oldWest = west;
		west = newWest;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Usixml_cuiPackage.BORDER_LAYOUT__WEST, oldWest, west));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship getCenter() {
		if (center != null && center.eIsProxy()) {
			InternalEObject oldCenter = (InternalEObject)center;
			center = (ConcreteGraphicalRelationship)eResolveProxy(oldCenter);
			if (center != oldCenter) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, Usixml_cuiPackage.BORDER_LAYOUT__CENTER, oldCenter, center));
			}
		}
		return center;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcreteGraphicalRelationship basicGetCenter() {
		return center;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCenter(ConcreteGraphicalRelationship newCenter) {
		ConcreteGraphicalRelationship oldCenter = center;
		center = newCenter;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Usixml_cuiPackage.BORDER_LAYOUT__CENTER, oldCenter, center));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Usixml_cuiPackage.BORDER_LAYOUT__NORTH:
				if (resolve) return getNorth();
				return basicGetNorth();
			case Usixml_cuiPackage.BORDER_LAYOUT__EAST:
				if (resolve) return getEast();
				return basicGetEast();
			case Usixml_cuiPackage.BORDER_LAYOUT__SOUTH:
				if (resolve) return getSouth();
				return basicGetSouth();
			case Usixml_cuiPackage.BORDER_LAYOUT__WEST:
				if (resolve) return getWest();
				return basicGetWest();
			case Usixml_cuiPackage.BORDER_LAYOUT__CENTER:
				if (resolve) return getCenter();
				return basicGetCenter();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Usixml_cuiPackage.BORDER_LAYOUT__NORTH:
				setNorth((ConcreteGraphicalRelationship)newValue);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__EAST:
				setEast((ConcreteGraphicalRelationship)newValue);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__SOUTH:
				setSouth((ConcreteGraphicalRelationship)newValue);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__WEST:
				setWest((ConcreteGraphicalRelationship)newValue);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__CENTER:
				setCenter((ConcreteGraphicalRelationship)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case Usixml_cuiPackage.BORDER_LAYOUT__NORTH:
				setNorth((ConcreteGraphicalRelationship)null);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__EAST:
				setEast((ConcreteGraphicalRelationship)null);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__SOUTH:
				setSouth((ConcreteGraphicalRelationship)null);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__WEST:
				setWest((ConcreteGraphicalRelationship)null);
				return;
			case Usixml_cuiPackage.BORDER_LAYOUT__CENTER:
				setCenter((ConcreteGraphicalRelationship)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Usixml_cuiPackage.BORDER_LAYOUT__NORTH:
				return north != null;
			case Usixml_cuiPackage.BORDER_LAYOUT__EAST:
				return east != null;
			case Usixml_cuiPackage.BORDER_LAYOUT__SOUTH:
				return south != null;
			case Usixml_cuiPackage.BORDER_LAYOUT__WEST:
				return west != null;
			case Usixml_cuiPackage.BORDER_LAYOUT__CENTER:
				return center != null;
		}
		return super.eIsSet(featureID);
	}

} //BorderLayoutImpl
